package com.yanqu.road.server.cmd.cross.activity;

import com.yanqu.road.pb.cross.activity.CrossActivityProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.cross.CrossDataMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_CROSS_ACTIVITY_NEW_RANK_CHANGE_HAS_ALL_SYNC, desc = "跨服冲榜排行全部同步")
public class CrossActivityNewRankChangeHasAllSyncCmd extends AbstractCommand {

	private int activityId;
	private int conditionType;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		CrossActivityProto.CrossActivityUserRankChangeRespMsg reqMsg = CrossActivityProto.CrossActivityUserRankChangeRespMsg.parseFrom(packet.getBytes());
		activityId = reqMsg.getActivityId();
		conditionType = reqMsg.getConditionType();
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		CrossDataMgr.addAllSyncRankActivityConditionType(activityId, conditionType);
	}

	@Override
	public void sendData(GamePlayer player) {

	}

}
